package com.xinxin.leetcode.problem476;

import java.util.Stack;

/**
 * @author ShiXinXin
 * @date 2020-01-04 22:35
 */
public class Solution {
    public int findComplement(int num) {
        long n = 1;
        while (n <= num) {
            n = n << 1;
        }
        return (int) (n - 1 - num);
    }

    public static void main(String[] args) {
        System.out.println(new Solution().findComplement(2147483647));
    }
}
